POV-Ray : Newsgroups : povray.binaries.images : Woven Cloth Texture : Re: Woven Cloth Texture Server Time
31 Jul 2024 14:32:59 EDT (-0400)
  Re: Woven Cloth Texture  
From: Ive
Date: 17 Feb 2010 05:08:51
Message: <4b7bc033$1@news.povray.org>
On 17.02.2010 00:48, Christian Froeschlin wrote:
> I redesigned this as a pigment by replacing the layered texture
> with a pigment_map. Therefore, you can now define a pigment function
> and use that as normal pattern. Nice texture BTW ;)
>
> #local ClothScale = .5;
> #local ThreadWidth = .2;
> #local EdgeWidth = .08;
>
> #declare P_Cloth = pigment
> {
> gradient x
> color_map
> {
> [0 color Black]
> [.1 color Black]
> [.5 color White * 4]
> [.9 color Black]
> [1 color Black]
> }
> }
>
> #declare P_Cloth = pigment
> {
> gradient y
> pigment_map
> {
> [0 color Black]
> [.5 - ThreadWidth / 2 - EdgeWidth color Black]
> [.5 - ThreadWidth / 2 P_Cloth]
> [.5 + ThreadWidth / 2 P_Cloth]
> [.5 + ThreadWidth / 2 + EdgeWidth color Black]
> [1 color Black]
> }
> }
>
> #declare P_Cloth = pigment
> {
> average
> pigment_map
> {
> [1 P_Cloth]
> [1 P_Cloth translate <.5, .5, 0>]
> [1 P_Cloth rotate 90 * z translate <.5, 0, 0>]
> [1 P_Cloth rotate 90 * z translate <0, .5, 0>]
> }
> scale <ClothScale, ClothScale, 1>
> }
>
> #declare f_cloth = function {pigment {P_Cloth}}
>
> #declare N_Cloth = normal {function {f_cloth(x,y,z).red}}
>

sorry, but this will not work (as expected) as the function you feed 
into the normal statement needs to evaluate the *slope* and not the 
*height* at a specific point in 3d space.

-Ive


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.